package com.abso.mp3tunes.locker.ui.preferences;

import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.swt.widgets.Composite;

/**
 * A field editor for a password type preference.
 */
public class PasswordFieldEditor extends StringFieldEditor {

	/**
	 * Constructs a new field editor.
	 * 
	 * @param name
	 *            the name of the preference this field editor works on.
	 * @param labelText
	 *            the label text of the field editor.
	 * @param parent
	 *            the parent of the field editor's control.
	 */
	public PasswordFieldEditor(String name, String labelText, Composite parent) {
		super(name, labelText, parent);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.jface.preference.StringFieldEditor#doFillIntoGrid(org.eclipse.swt.widgets.Composite,
	 *      int)
	 */
	protected void doFillIntoGrid(Composite parent, int numColumns) {
		super.doFillIntoGrid(parent, numColumns);
		getTextControl().setEchoChar('*');
	}

}
